package com.wm.web.controller.system;


import com.wm.common.core.controller.BaseController;
import com.wm.common.core.domain.AjaxResult;
import com.wm.common.core.page.TableDataInfo;
import com.wm.system.domain.SellingCar;
import com.wm.system.service.ISellingCarService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hyq
 * @since 2023-10-09 22:33:01
 */
@RestController
@RequestMapping("/system/sellingCar")
public class SellingCarController extends BaseController {

    @Autowired
    private ISellingCarService service;

    @ApiOperation("高价买车分页查询")
    @GetMapping("list")
    public TableDataInfo list(SellingCar sellingCar){
        startPage();
        List<SellingCar> carList = service.selectSellingCar(sellingCar);
        return getDataTable(carList);
    }

    @ApiOperation("高价买车新增和修改")
    @PostMapping("addOrUpdate")
    public AjaxResult addOrUpdate(@RequestBody SellingCar sellingCar){
        service.addOrUpdate(sellingCar);
        return AjaxResult.success();
    }
}
